<template>
  <div class="digital">
    <div class="digital-report">
      <div v-if="digitalReportTitle && isShow" class="digital-report-title">
        <div class="report-title">{{ title }}</div>
        <div class="tableButton">
          <el-button
            v-for="item in tableButtons"
            :key="item.buttonId"
            :type="item.buttonCode === 1 ? 'primary' : ''"
            :class="
              item.buttonCode === 2
                ? 'delbtn'
                : item.buttonCode === 1
                  ? 'addbtn'
                  : 'tablebtn'
            "
            :loading="item.buttonCode === 7 ? btnFlag : false"
            @click="tablebtn(item.buttonCode, item)"
          ><i v-if="item.buttonCode === 6" class="el-icon-setting" />
            {{ item.buttonName }}</el-button>
        </div>
      </div>
      <div class="digital-report-tabs">
        <!-- //是否配置查看详情按钮 -->
        <div v-if="lookBtnTrue" class="digital-report-tabs-tips">双击查看详情</div>
        <el-tabs v-model="activeTab" @tab-click="tabClick">
          <el-tab-pane
            v-for="item in parentHeaderData.childrenTableInfos"
            :key="item.id"
            :label="item.tableName"
            :data="item"
          />
        </el-tabs>
      </div>
      <div
        ref="digitalReportTabs"
        class="digital-report-body"
        :style="{
          height: digitalReportTitle
            ? 'calc(100% - 160px)'
            : 'calc(100% - 90px)'
        }"
      >
        <div v-if="loading" class="commonComponent_container_skeleton">
          <a-skeleton
            :width="60"
            active
            :paragraph="{
              rows: 5,
              width: '100%'
            }"
            :title="{
              width: '40%'
            }"
          />
        </div>
        <keep-alive>
          <component
            :is="apps"
            ref="commonComponents"
            :table-id="tableId"
            :table-type="tableType"
            :is-search="isSearch"
            :flag="flag"
            :is-vertical-form="false"
            @cellDblclick="cellDblclick"
          />
        </keep-alive>
      </div>
      <div v-if="pagination" class="digital-report-pagination">
        <el-pagination
          background
          :total="(form[tableId] && form[tableId] && form[tableId].total) || 0"
          :current-page="
            (form[tableId] &&
              form[tableId].searchBodyParams &&
              form[tableId].searchBodyParams.pageIndex + 1) ||
              1
          "
          :page-sizes="pageSizes"
          :page-size="
            (form[tableId] &&
              form[tableId].searchBodyParams &&
              form[tableId].searchBodyParams.pageSize) ||
              pageSizes[0]
          "
          :layout="layout"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
        />
      </div>
      <!-- {{ form[tableId].page }} -->
      <MyDialog
        :is-show="dialogVisible"
        :render-key="renderKey"
        :table-id="tableId"
        :userid="userId"
        :component="component"
        :is-process="isProcess"
        :specila-menu-id="specilaMenuId"
        :menu-type="menuType"
        :click-btn-item-now="clickBtnItemNow"
        :db-table-row-info="dbTableRowInfo"
        @close="closeDialog"
        @changeData="changeData"
        @findisBindchecked="findisBindchecked"
      />
    </div>
    <div :class="editorBtnflag ? 'editor_box editorTwo' : 'editor_box'">
      <div id="editor" ref="editor" />
      <div v-if="editorBtnflag" class="editorBtn">
        <!-- <el-button size="small" v-print="'.w-e-text-container'" @click="btnPrint">打印</el-button> -->
        <el-button v-print="'#editor'" type="primary" plain size="small">打印</el-button>
        <el-button size="small" @click="editorHandle">取消</el-button>
        <el-button
          type="primary"
          size="small"
          @click="editorBtn"
        >确认</el-button>
      </div>
    </div>

    <a-modal
      title="发票识别"
      :visible="quotaInvoiceVisible"
      ok-text="确认"
      cancel-text="取消"
      @ok="quotaInvoiceOk"
      @cancel="quotaInvoiceCancel"
    >
      <quotainvoiceFrom :from-data="quotaInvoiceData" :quotainvoice-flag="quotainvoiceFlag" />
    </a-modal>
    <!-- 批量编辑 -->
    <batch-edit
      :is-show.sync="batchEditShow"
      :headers="batchEditHeader"
      :body="batchEditBody"
      :table-id="tableId"
      @updataTable="updataTable"
    />
  </div>
</template>

<script>
import { TabsTableMixins } from '@/views/commonPropertypage/components/TabsTableMixins';
import {
  getQueryBodyByProduce,
  getReportHeaderByTableId,
  getReportParentHeader
} from '@/api/dynamicInterface';
import E from 'wangeditor';
// import UE from 'wangeditor'
import {
  getByUserAndTableId,
  delTable,
  downloadTable,
  findPrintConfigByTableId,
  getupload,
  delmoreTable,
  getNotice,
  addNotice,
  downLoadNotice
} from '@/api/commonPropertypage/index';
import MyDialog from '@/views/digitalReport/components/MyDialog.vue';
import { getKeyByMenuId } from '@/api/propertyHomePage/index';
import { getQuotaInvoice, getVatInvoice } from '@/api/quotaInvoice/index';
import quotainvoiceFrom from '@/views/quotaInvoice/components/quotainvoiceFrom.vue';
import BatchEdit from '@/components/tableCommon/components/BatchEdit.vue';
import { deletePhysicalTable } from '@/api/dynamicInterface';
import p from '@/utils/processRequest1';
import debounce from 'lodash/debounce';
import { downFileNew } from '@/api/filePage';
import bus from '@/utils/eventBus1.js';
import specialMixins from './common/specialMixins.js';
import Vue from 'vue';
import Print from 'vue-print-nb';
Vue.use(Print);
import _ from 'lodash';
export default {
  name: 'DigitalReport',
  components: {
    MyDialog,
    quotainvoiceFrom,
    BatchEdit
  },
  mixins: [TabsTableMixins, specialMixins],
  provide() {
    return {
      form: () => this.form,
      sourceData: () => Object.assign({}, this.$data, this.$props)
    };
  },
  props: {
    // 自定义的流程(非必须)
    flag: {
      type: String,
      default: '0'
    },
    // 菜单ID(必须)
    menuId: {
      type: Number,
      default: undefined,
      require: true
    },
    // 表单号(非必须)
    formGuid: {
      type: String,
      default: ''
    },
    // 表报标题(非必须)
    title: {
      type: String,
      default: ''
    },
    // 表报上面的删除等按钮是否显示(非必须)
    isShow: {
      type: Boolean,
      default: true
    },
    // 表报数据的过滤条件数组(设置后所有请求都会带filterList的过滤,非必须)
    filterList: {
      type: Array,
      default: () => []
    },
    // 表报请求中的cprogramname参数(非必须)
    programe: {
      type: String,
      default: ''
    },
    // 切换的tabs标签索引(非必须)
    tabsIndex: {
      type: String,
      default: '0'
    },
    // 是否显示页脚
    pagination: {
      type: Boolean,
      default: true
    },
    pageSizes: {
      type: Array,
      default: () => [100, 200, 500, 1000]
    },
    layout: {
      type: String,
      default: 'prev, pager, next, sizes, jumper'
    },
    // 表报上面的删除等按钮是否显示(非必须)
    isSearch: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {
      specialHeaderDate: [],
      chooseList: [],
      clickBtnItemNow: {}, // 当前点击的按钮
      apps: '',
      component: '',
      isProcess: 1,
      specilaMenuId: '',
      emptyAppWarn: false,
      activeTab: '0',
      tableId: undefined,
      dialogVisible: false,
      downName: '',
      parentHeaderData: {},
      form: {},
      tableType: undefined,
      loading: false,
      tableName: '',
      renderKey: {
        key: '',
        title: '',
        width: '',
        table: [],
        len: '',
        headerArr: [],
        form: '',
        tablen: '',
        flagAll: '',
        buttonCode: undefined
      },
      tableButtons: [],
      userId: localStorage.getItem('xcUserId'),
      dataList: [],
      btnFlag: false,
      editor: null,
      editorBtnflag: false,
      editorHtml: '',
      editorstatus: 3,
      editorGuid: '',
      quotaInvoiceData: {},
      quotaInvoiceVisible: false,
      quotainvoiceFlag: '',
      // 双击查看信息
      dbClickInfoBtn: {},
      // 双击的行数据
      dbTableRowInfo: {},
      // 当前菜单类型
      menuType: 0,
      // 批量编辑弹框
      batchEditShow: false,
      // 批量编辑表头
      batchEditHeader: [],
      batchEditBody: [],
      tabInfo: {}
    };
  },
  computed: {
    digitalReportTitle() {
      return this.title || (this.tableButtons && this.tableButtons.length) && this.isShow;
    },
    // 改页签报表是否配置查看详情按钮
    lookBtnTrue() {
      const tabsIndex = Number(this.activeTab) || 0;
      const childrenTableInfo = this.parentHeaderData && this.parentHeaderData.childrenTableInfos && this.parentHeaderData.childrenTableInfos[tabsIndex];
      const lookBtn = childrenTableInfo && childrenTableInfo.buttons && childrenTableInfo.buttons.length && childrenTableInfo.buttons.find(i => i.buttonCode === 20);
      return lookBtn;
    },
    menuList() {
      return this.$store.state.permission.menuList;
    }
  },
  watch: {
    menuId(a) {
      this.form = {};
      this.activeTab = '0';
      this.initPage();
    },
    filterList(a) {
      this.form = {};
      this.activeTab = '0';
      this.initPage();
    },
    tabsIndex(a) {
      const tabInfo = this.parentHeaderData.childrenTableInfos;
      this.activeTab = a;
      const data = tabInfo[Number(a)];
      const obj = { $attrs: { data }};
      this.tabClick(obj);
    }
  },
  created() {
    this.loading = true;
    this.initPage = debounce(this.initPage, 500);
    this.menuId && this.initPage();
    bus.$on('checkboxChangeEvent', (data) => {
      this.chooseList = [];
      this.chooseList = data;
    });
    // this.initPage();
  },
  beforeDestroy() {
    // 销毁编辑器
    if (this.editor) {
      this.editor.destroy();
      this.editor = null;
    }
  },
  methods: {
    tabsIndexChange(index) {
      const tabInfo = this.parentHeaderData.childrenTableInfos;
      this.activeTab = index;
      const data = tabInfo[Number(index)];
      const obj = { $attrs: { data }};
      this.tabClick(obj);
    },
    // 获取组件data
    async getComponentsData() {
      // 取数据
      const initData = this.$refs.commonComponents && this.$refs.commonComponents.initData;
      initData && await initData(); // 在组件内定义一个取数据的方法s
      this.loading = false;
    },

    cellDblclick(val) {
      if (val.SFTDXYM) {
        this.$emit('cellDblclick', val);
      } else {
        // 报表没有配置查看详情按钮就不显示
        if (this.lookBtnTrue) {
          const { component, menuId, isProcess, buttonName } = this.dbClickInfoBtn;
          // 有menuId这显示流程,否则显示表头
          if (component && menuId) {
            this.$route.query.formGuid = val.FORMGUID;
            this.$route.query.flag = '1';
            this.component = component;
            this.isProcess = isProcess;
            this.specilaMenuId = menuId;
          } else {
            this.renderKey.form = this.form[this.tableId];
          }
          // 直接赋值没有触发计算属性重新计算
          // this.renderKey.buttonCode = 20;
          this.$set(this.renderKey, 'buttonCode', 20);
          this.renderKey.title = buttonName;
          this.clickBtnItemNow = this.dbClickInfoBtn;
          this.dbTableRowInfo = val;
          // 双击查看
          this.dialogVisible = true;
        }
      }
    },

    deepInitTableHeader(data) {
      if (Array.isArray(data)) {
        data.forEach(item => {
          this.deepInitTableHeader(item);
        });
      } else {
        if (data.children) {
          this.deepInitTableHeader(data.children);
        } else {
          const item = data;
          if (item.colspanCount >= 4) {
            item.myValue = item.title;
          } else {
            item.myValue = ''; // 存放数据（用于提交）
          }
          item.opintion = []; // 下拉框存放选中的数据
          item.treeSelectItem = {}; // 下拉框存放选中的数据
          item.editMark = false; // 标记是否被编辑过
          item.selectViewOptions = item.selectViewOptions || {
            renderKey: 'lable',
            renderMapKey: 'value',
            renderValue: 'lable'
          };
        }
      }
    },

    async getHeaderByTableId(styleHead, isLoadData) {
      const { tableId, tableName, tableType } = this;
      const { storedReturnType, isAuthority, storedName } = styleHead;
      await getReportHeaderByTableId({
        tableId
      }).then(async res => {
        const { success, data } = res;
        if (success && data) {
          data.sort((a, b) => a.orderId - b.orderId);
          this.deepInitTableHeader(data);
          const searchBodyParams = {
            pageIndex: 0,
            pageSize: this.pageSizes[0],
            pageType: 1,
            filterList: this.filterList,
            cprogramname: this.programe
          };
          storedReturnType && (searchBodyParams.resultAsTree = true);
          // 开启权限控制
          isAuthority && (searchBodyParams.operator = localStorage.getItem('xcUserId'));
          this.form[tableId] = {
            headers: data,
            tableName,
            tableType,
            searchReport: this.searchReport,
            styleHead,
            searchBodyParams,
            tabInfo: this.tabInfo
          };
          if (isLoadData === 'stop') {
            this.form[tableId].bodys = [];
            this.form[tableId].total = 0;
            setTimeout(async() => {
              await this.getComponentsData();
              const { searchList, tableHeight } = this.form[tableId];
              const offsetHeight = this.$refs.digitalReportTabs && this.$refs.digitalReportTabs.offsetHeight;
              if (searchList && searchList.length && !tableHeight) {
                this.form[tableId].tableHeight = offsetHeight - 80 + 'px';
              } else if (searchList && !searchList.length && !tableHeight) {
                this.form[tableId].tableHeight = offsetHeight + 'px';
              }
            }, 500);
            return;
          }
          let url;
          storedName ? url = '/dynamicReportForm/queryBodyByProduce' : url = '/physicalTable/selDataByTable';
          await getQueryBodyByProduce({
            tableId,
            ...searchBodyParams
          }, url).then(res => {
            if (res.success && res.data) {
              this.form[tableId].bodys = res.data;
              this.form[tableId].total = res.total;
              setTimeout(async() => {
                await this.getComponentsData();
                const { searchList, tableHeight } = this.form[tableId];
                const offsetHeight = this.$refs.digitalReportTabs && this.$refs.digitalReportTabs.offsetHeight;
                if (searchList && searchList.length && !tableHeight) {
                  this.form[tableId].tableHeight = offsetHeight - 80 + 'px';
                } else if (searchList && !searchList.length && !tableHeight) {
                  this.form[tableId].tableHeight = offsetHeight + 'px';
                }
              }, 500);
            } else {
              this.form[tableId].bodys = [];
              this.form[tableId].total = 0;
              setTimeout(() => {
                this.getComponentsData();
              }, 300);
            }
          });
        } else {
          this.form[tableId] = {};
          this.apps = '';
          this.$message.warning(res.message);
        }
      });
    },
    searchReport(obj) {
      const { tableId, form } = this;
      form[tableId].searchBodyParams.pageIndex = 0;
      form[tableId].searchBodyParams.pageSize = this.pageSizes[0];
      const filterList = [];
      // 递归获取表头所有
      const headerArr = [];
      const getHeaderArrFun = (arr) => {
        arr.forEach(item => {
          if (item.children && item.children.length) {
            getHeaderArrFun(item.children);
          } else {
            headerArr.push(item);
          }
        });
      };
      getHeaderArrFun(form[tableId].headers);
      for (const key in obj) {
        if (obj[key] !== '' && obj[key] !== undefined) {
          if (Array.isArray(obj[key])) {
            const searchList = form[tableId].searchList.concat(form[tableId].moreSearchList).concat(headerArr);
            const componentType = searchList.find(item => item.dataIndex === key).componentType;
            if (['monthDateSelectRange', 'dayDateSelectRange'].includes(componentType)) {
              if (obj[key].length) {
                // 日选择
                if (componentType === 'dayDateSelectRange') {
                  filterList.push({
                    col: key,
                    value: obj[key][0],
                    symbol: 'gte_d'
                  });
                  filterList.push({
                    col: key,
                    value: obj[key][1],
                    symbol: 'lte_d'
                  });
                } else {
                  filterList.push({
                    col: key,
                    value: obj[key][0] + '-01',
                    symbol: 'gte_d'
                  });
                  filterList.push({
                    col: key,
                    value: obj[key][1] + '-01',
                    symbol: 'lte_d'
                  });
                }
              }
            } else {
              const requestData = _.cloneDeep(obj[key]);
              for (let i = 0; i < requestData.length; i++) {
                requestData[i] = `\'\'${requestData[i]}\'\'`;
              }
              filterList.push({
                col: key,
                value: requestData.join(','),
                symbol: 'in'
              });
            }
          } else if (obj[key] === ' ') {
            filterList.push({
              col: key,
              value: obj[key],
              symbol: '@ISNULL'
            });
          } else {
            const searchList = form[tableId].searchList.concat(form[tableId].moreSearchList).concat(headerArr);
            const componentType = searchList.find(item => item.dataIndex === key).componentType;
            if (['yearDateSelect', 'monthDateSelect', 'dayDateSelect'].includes(componentType)) {
              filterList.push({
                col: key,
                value: obj[key],
                symbol: 'eq_d'
              });
            } else {
              filterList.push({
                col: key,
                value: obj[key]
              });
            }
          }
        }
      }
      form[tableId].searchBodyParams.filterList = filterList.concat(
        this.filterList
      );
      this.getQueryBodyByProduce({
        tableId,
        ...form[tableId].searchBodyParams
      });
    },
    async getQueryBodyByProduce(data) {
      const { form, tableId } = this;
      this.loading = true;
      let url;
      form[tableId].styleHead.storedName ? url = '/dynamicReportForm/queryBodyByProduce' : url = '/physicalTable/selDataByTable';
      await getQueryBodyByProduce({ ...data }, url).then(res => {
        const { success, data, total } = res;
        if (success && data) {
          this.form[this.tableId].radioSelectRow = {};
          this.form[this.tableId].checkbox = [];
          form[tableId].bodys = data;
          form[tableId].total = total;
        } else {
          form[tableId].bodys = [];
          form[tableId].total = 0;
        }
      });
      this.loading = false;
    },
    closeDialog() {
      this.dialogVisible = false;
      this.$route.query.menuId = this.menuId;
      this.component = '';
      setTimeout(() => {
        this.renderKey.key = '';
        this.renderKey.table = [];
        this.renderKey.len = '';
        this.renderKey.headerArr = [];
        this.renderKey.form = '';
        this.renderKey.width = '';
        this.renderKey.tablen = '';
        this.renderKey.flagAll = ';';
      }, 200);
    },
    fromdeploy(val) {
      this.dialogVisible = true;
      this.renderKey.title = val;
    },
    addcheck(arr) {
      arr.forEach(item => {
        if (item.isBind === 0) {
          item.isBind = false;
        } else {
          item.isBind = true;
        }
        if (item.children) {
          this.addcheck(item.children);
        }
      });
    },
    findHeader(arr) {
      if (this.renderKey.tablen) {
        arr.forEach(item => {
          if (item.isBind) {
            this.renderKey.headerArr.push({
              headerId: item.id,
              orderId: item.orderId
            });
          }
          if (item.children) {
            this.findHeader(item.children);
          }
        });
      } else {
        arr.forEach(item => {
          this.renderKey.headerArr.push({
            headerId: item.id,
            orderId: item.orderId
          });
          if (item.children) {
            this.findHeader(item.children);
          }
        });
      }
    },
    sortArr(arr) {
      arr.sort(function(a, b) {
        return a.orderId - b.orderId;
      });
      arr.forEach(item => {
        if (item.children) {
          this.sortArr(item.children);
        }
      });
    },

    pageJump(item) {
      getKeyByMenuId({
        menuId: item.menuId
      }).then(res => {
        if (res.success) {
          const {
            groups: { name }
          } = /\/(?<name>\w+$)/.exec(item.path);
          const params = {
            path: item.path,
            query: {
              name,
              title: item.title,
              sId: res.data.sId.split('-')[0],
              key: res.data.key,
              defId: res.data.id,
              bizKey: '',
              flag: 0,
              fileType: res.data.fileType,
              menuId: item.menuId,
              formGuid: '',
              taskId: '',
              isShow: true
              // isHideTop: 1
            }

          };
          this.$router.push(params);
          // const routeUrl = this.$router.resolve(params);
          // const tempwindow = window.open('_blank'); // 先打开页面
          // tempwindow.location = routeUrl.href; // 后更改页面地址
        } else {
          this.$message({
            message: '该菜单存在问题，请联系运维人员',
            type: 'warning'
          });
        }
      });
    },

    findisBind(arr) {
      arr.forEach(item => {
        if (item.isBind === true) {
          this.renderKey.tablen++;
        }
        if (item.children) {
          this.findisBind(item.children);
        }
      });
    },
    changeData() {
      this.renderKey.headerArr = [];
    },
    findisBindchecked(arr) {
      arr.forEach(item => {
        if (item.isBind) {
          this.renderKey.headerArr.push({
            headerId: item.id,
            orderId: item.orderId
          });
        }
        if (item.children) {
          this.findisBindchecked(item.children);
        }
      });
    },
    finddatalen(arr, num = 0) {
      num = arr.length + num;
      arr.forEach(item => {
        if (item.children) {
          this.finddatalen(item.children, num);
        }
      });
    },
    async tablebtn(val, item) {
      console.log(val);
      const { buttonName, buttonCode } = item;
      this.clickBtnItemNow = item;
      this.renderKey.title = buttonName;
      this.renderKey.buttonCode = buttonCode;
      this.renderKey.form = this.form[this.tableId];
      // 获取当前地址的所属菜单
      const getMune = (arr) => {
        arr.forEach(i => {
          if (i.path === this.$route.path) {
            this.menuType = i.type;
            return;
          } else {
            if (i.children && i.children.length) {
              getMune(i.children);
            }
          }
        });
      };
      getMune(this.menuList);
      if (val === 1) {
        if (this.menuType === 10) {
          this.renderKey.form = this.form[this.tableId];
          this.dialogVisible = true;
          return;
        }
        // 添加
        // this.dialogVisible = true;
        // this.renderKey.form = this.form[this.tableId];
        this.$route.query.formGuid = '';
        this.$route.query.menuId = item.menuId;
        if (Number(item.isProcess) && item.component) {
          this.pageJump(item);
        } else if (item.component) {
          this.dialogVisible = true;
          this.component = item.component;
          this.isProcess = item.isProcess;
          this.specilaMenuId = item.menuId;
        } else {
          this.renderKey.form = this.form[this.tableId];
          this.dialogVisible = true;
        }
      } else if (val === 6) {
        // 表头配置
        this.renderKey.width = '398px';
        const res = await getByUserAndTableId({
          tableId: this.tableId,
          userId: this.userId,
          resultAsTree: true
        });
        this.renderKey.table = res.data;
        this.sortArr(this.renderKey.table);
        // this.renderKey.table.forEach(item => {
        //   if (item.children) {
        //     this.sortArr(item.children);
        //   }
        // });
        this.renderKey.table.forEach((item, index) => {
          if (item.orderId === '') {
            this.renderKey.table.splice(index, 1);
            this.renderKey.table.push(item);
          }
          // this.addflag(this.renderKey.table)
        });
        this.addcheck(this.renderKey.table);
        this.findisBind(this.renderKey.table);
        this.findHeader(res.data);
        // this.renderKey.form = this.form[this.tableId];
        this.dialogVisible = true;
        getByUserAndTableId({
          tableId: this.tableId,
          userId: this.userId
        }).then(res => {
          this.renderKey.len = res.data.length;
          if (this.renderKey.len === this.renderKey.tablen) {
            this.renderKey.flagAll = true;
          } else {
            this.renderKey.flagAll = false;
          }
        });
      } else if (val === 2) {
        // 删除
        const checkList = this.getCheckRowList();
        if (!checkList.length) {
          this.$message.warning('请勾选相应表单后进行删除');
        } else {
          // 走物理表
          const { form, tableId } = this;
          this.$confirm('此操作将永久删除文件, 是否继续?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            // 走物理表删除
            if (this.menuType === 10) {
              // 物理表删除目前只有单行删除
              if (checkList.length > 1) {
                this.$message.warning('只能勾选一个表单进行编辑');
              } else {
                const filterList = [];
                const physicalTableKey = JSON.parse(this.tabInfo.physicalTableKey);
                const physicalTableKeyList = [];
                physicalTableKey.forEach(i => {
                  physicalTableKeyList.push({
                    dataIndex: i,
                    value: checkList[0][i]
                  });
                });
                physicalTableKeyList.forEach(i => {
                  if (
                    [
                      'yearDateSelect',
                      'monthDateSelect',
                      'dayDateSelect',
                      'monthDateSelectRange',
                      'dayDateSelectRange'
                    ].includes(i.componentType)
                  ) {
                    filterList.push({
                      col: i.dataIndex,
                      symbol: 'eq_d',
                      value: checkList[0][i.dataIndex]
                    });
                  } else {
                    filterList.push({
                      col: i.dataIndex,
                      symbol: checkList[0][i.dataIndex] === '' ? '' : 'eq',
                      value: checkList[0][i.dataIndex]
                    });
                  }
                });
                const request = {
                  tableId,
                  filterList
                };
                deletePhysicalTable(request).then(res => {
                  const { message, success } = res;
                  if (success) {
                    this.$message({
                      showClose: true,
                      message,
                      type: 'success'
                    });
                    this.getQueryBodyByProduce({
                      tableId,
                      ...form[tableId].searchBodyParams
                    });
                  } else {
                    this.$message({
                      showClose: true,
                      message: message || '删除失败',
                      type: 'warning'
                    });
                  }
                });
              }
            } else {
              // 单删除
              if (checkList.length === 1) {
                delTable({
                  formGuid: checkList[0].FORMGUID || checkList[0].formGuid,
                  rowNum: checkList[0].ROW_NUM || checkList[0].rowNum,
                  tableId: checkList[0].TABLEID || tableId
                }).then(res => {
                  if (res.success) {
                    this.$message({
                      showClose: true,
                      message: res.message,
                      type: 'success'
                    });
                    this.getQueryBodyByProduce({
                      tableId,
                      ...form[tableId].searchBodyParams
                    });
                  } else {
                    this.$message({
                      showClose: true,
                      message: res.message || '删除失败',
                      type: 'warning'
                    });
                  }
                });
              // 批量删除
              } else {
                const arr = [];
                checkList.forEach(item => {
                  arr.push({
                    formGuid: item.FORMGUID || item.formGuid,
                    rowNum: item.ROW_NUM || item.rowNum,
                    tableId: item.TABLEID || tableId
                  });
                });
                delmoreTable(arr)
                  .then(res => {
                    if (res.success) {
                      this.$message({
                        showClose: true,
                        message: res.message,
                        type: 'success'
                      });
                      this.getQueryBodyByProduce({
                        tableId,
                        ...form[tableId].searchBodyParams
                      });
                    } else {
                      this.$message({
                        showClose: true,
                        message: res.message || '删除失败',
                        type: 'warning'
                      });
                    }
                  });
              }
            }
          }).catch(() => {
            this.$message({
              type: 'info',
              message: '已取消删除'
            });
          });
        }

        // 删除
        // const { form, tableId } = this;
        // this.parentHeaderData.childrenTableInfos.forEach(item => {
        //   if (item.id === this.tableId) {
        //     if (item.lineSelect === 1) {
        //       if (Object.keys(this.form[this.tableId].radioSelectRow).length) {
        //         this.$confirm('此操作将永久删除该表单, 是否继续?', '提示', {
        //           confirmButtonText: '确定',
        //           cancelButtonText: '取消',
        //           type: 'warning'
        //         })
        //           .then(() => {
        //             delTable({
        //               formGuid:
        //                 this.form[this.tableId].radioSelectRow.FORMGUID ===
        //                 undefined
        //                   ? this.form[this.tableId].radioSelectRow.formGuid
        //                   : this.form[this.tableId].radioSelectRow.FORMGUID,
        //               rowNum:
        //                 this.form[this.tableId].radioSelectRow.ROW_NUM ===
        //                 undefined
        //                   ? this.form[this.tableId].radioSelectRow.rowNum
        //                   : this.form[this.tableId].radioSelectRow.ROW_NUM,
        //               tableId:
        //                 this.form[this.tableId].radioSelectRow.TABLEID ===
        //                 undefined
        //                   ? this.tableId
        //                   : this.form[this.tableId].radioSelectRow.TABLEID
        //             }).then(res => {
        //               if (res.success) {
        //                 this.$message({
        //                   showClose: true,
        //                   message: res.message,
        //                   type: 'success'
        //                 });
        //                 this.getQueryBodyByProduce({
        //                   tableId,
        //                   ...form[tableId].searchBodyParams
        //                 });
        //               } else {
        //                 this.$message({
        //                   showClose: true,
        //                   message: res.message || '删除失败',
        //                   type: 'warning'
        //                 });
        //               }
        //             });
        //           })
        //           .catch(() => {
        //             this.$message({
        //               type: 'info',
        //               message: '已取消删除'
        //             });
        //           });
        //       } else {
        //         this.$message({
        //           message: '请勾选相应表单后进行删除',
        //           type: 'warning'
        //         });
        //       }
        //     } else if (item.lineSelect === 2) {
        //       if (this.form[this.tableId].checkbox.length === 1) {
        //         this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
        //           confirmButtonText: '确定',
        //           cancelButtonText: '取消',
        //           type: 'warning'
        //         })
        //           .then(() => {
        //             delTable({
        //               formGuid:
        //                 this.form[this.tableId].checkbox[0].FORMGUID ===
        //                 undefined
        //                   ? this.form[this.tableId].checkbox[0].formGuid
        //                   : this.form[this.tableId].checkbox[0].FORMGUID,
        //               rowNum:
        //                 this.form[this.tableId].checkbox[0].ROW_NUM ===
        //                 undefined
        //                   ? this.form[this.tableId].checkbox[0].rowNum
        //                   : this.form[this.tableId].checkbox[0].ROW_NUM,
        //               tableId:
        //                 this.form[this.tableId].checkbox[0].TABLEID ===
        //                 undefined
        //                   ? this.tableId
        //                   : this.form[this.tableId].checkbox[0].TABLEID
        //             }).then(res => {
        //               if (res.success) {
        //                 this.$message({
        //                   showClose: true,
        //                   message: res.message,
        //                   type: 'success'
        //                 });
        //                 this.getQueryBodyByProduce({
        //                   tableId,
        //                   ...form[tableId].searchBodyParams
        //                 });
        //               } else {
        //                 this.$message({
        //                   showClose: true,
        //                   message: res.message || '删除失败',
        //                   type: 'warning'
        //                 });
        //               }
        //             });
        //           })
        //           .catch(() => {
        //             this.$message({
        //               type: 'info',
        //               message: '已取消删除'
        //             });
        //           });
        //       } else if (this.form[this.tableId].checkbox.length < 1) {
        //         this.$message({
        //           message: '请勾选相应表单后进行删除',
        //           type: 'warning'
        //         });
        //       } else {
        //         this.$confirm('此操作将永久删除该表单, 是否继续?', '提示', {
        //           confirmButtonText: '确定',
        //           cancelButtonText: '取消',
        //           type: 'warning'
        //         }).then(() => {
        //           const arr = [];
        //           this.form[this.tableId].checkbox.forEach(item => {
        //             arr.push({
        //               formGuid:
        //                 item.FORMGUID === undefined
        //                   ? item.formGuid
        //                   : item.FORMGUID,
        //               rowNum:
        //                 item.ROW_NUM === undefined ? item.rowNum : item.ROW_NUM,
        //               tableId:
        //                 item.TABLEID === undefined ? this.tableId : item.TABLEID
        //             });
        //           });
        //           delmoreTable(arr)
        //             .then(res => {
        //               if (res.success) {
        //                 this.$message({
        //                   showClose: true,
        //                   message: res.message,
        //                   type: 'success'
        //                 });
        //                 this.getQueryBodyByProduce({
        //                   tableId,
        //                   ...form[tableId].searchBodyParams
        //                 });
        //               } else {
        //                 this.$message({
        //                   showClose: true,
        //                   message: res.message || '删除失败',
        //                   type: 'warning'
        //                 });
        //               }
        //             })
        //             .catch(() => {
        //               this.$message({
        //                 type: 'info',
        //                 message: '已取消删除'
        //               });
        //             });
        //         });
        //       }
        //     }
        //   }
        // });
      } else if (val === 3) {
        // 编辑
        if (!this.getCheckRowList().length) {
          this.$message.warning('请勾选相应表单后进行编辑');
        } else if (this.getCheckRowList().length > 1) {
          this.$message.warning('只能勾选一个表单进行编辑');
        } else {
          // 走物理表单
          if (this.menuType === 10) {
            this.dialogVisible = true;
            return;
          }
          if (item.component) {
            this.$route.query.formGuid = this.getCheckRowList()[0].FORMGUID;
            this.component = item.component;
            this.isProcess = item.isProcess;
            this.specilaMenuId = item.menuId;
          }
          this.dialogVisible = true;
        }
      } else if (val === 5) {
        // 下载
        const { tableId } = this;
        const { data } = await findPrintConfigByTableId({
          tableId: this.tableId
        });
        if (data.length) {
          this.downName = data[0].title;
        } else {
          this.downName = this.form[this.tableId].tableName;
          this.$message({
            message: '请配置下载模版',
            type: 'warning'
          });
        }
        downloadTable({
          tableId,
          queryBodyByProduceEntity: {
            tableId,
            ...this.form[this.tableId].searchBodyParams
          }

        })
          .then(res => {
            // var blob = new Blob([res], {
            //   type:
            //     'application/vnd.openxmlformats-  officedocument.spreadsheetml.sheet;charset=utf-8'
            // }); //type这里表示xlsx类型
            var downloadElement = document.createElement('a');
            var href = window.URL.createObjectURL(res); // 创建下载的链接
            downloadElement.href = href;
            downloadElement.download = `${this.downName}.xls`; // 下载后文件名
            document.body.appendChild(downloadElement);
            downloadElement.click(); // 点击下载
            document.body.removeChild(downloadElement); // 下载完成移除元素
            window.URL.revokeObjectURL(href); // 释放掉blob对象
          })
          .catch(res => {
            this.$message({
              message: '下载失败！',
              type: 'error',
              showClose: true
            });
          });
      } else if (val === 7) {
        // 导入
        const selFileEle = document.createElement('input');
        selFileEle.setAttribute('type', 'file');
        selFileEle.click();
        selFileEle.onchange = async e => {
          // console.log(e);
          let file = [];
          if (e.path) {
            file = e.path[0].files[0];
          } else {
            file = e.target.files[0];
          }
          if (file.name.split('.')[1] !== 'xls') {
            this.$message({
              message: '导入文件只支持xls格式',
              type: 'warning'
            });
            return;
          }
          this.btnFlag = true;
          const data = new FormData();
          data.append('file', file);
          data.append(
            'sheetInfo',
            JSON.stringify([
              {
                sheetnum: 1,
                headerStart: 2,
                headerEnd:
                  2 + this.getnumheader(this.form[this.tableId].headers),
                bodyStart:
                  3 + this.getnumheader(this.form[this.tableId].headers)
              }
            ])
          );

          data.append('tableId', this.tableId);
          const res = await getupload(data);
          if (res.success) {
            this.btnFlag = false;
            this.$message({
              message: res.message,
              type: 'success'
            });
            this.getHeaderByTableId(this.form[this.tableId].styleHead);
          } else {
            this.$message({
              message: res.message,
              type: 'warning'
            });
            this.btnFlag = false;
          }
        };
      } else if (val === 8) {
        // 模板下载
        const { tableId } = this;
        const { data } = await findPrintConfigByTableId({
          tableId: this.tableId
        });
        if (data.length) {
          this.downName = data[0].title;
        } else {
          this.downName = this.form[this.tableId].tableName;
          this.$message({
            message: '请配置下载模版',
            type: 'warning'
          });
        }
        downloadTable({
          tableId
        })
          .then(res => {
            // var blob = new Blob([res], {
            //   type:
            //     'application/vnd.openxmlformats-  officedocument.spreadsheetml.sheet;charset=utf-8'
            // }); //type这里表示xlsx类型
            var downloadElement = document.createElement('a');
            var href = window.URL.createObjectURL(res); // 创建下载的链接
            downloadElement.href = href;
            downloadElement.download = `${this.downName}.xls`; // 下载后文件名
            document.body.appendChild(downloadElement);
            downloadElement.click(); // 点击下载
            document.body.removeChild(downloadElement); // 下载完成移除元素
            window.URL.revokeObjectURL(href); // 释放掉blob对象
          })
          .catch(res => {
            this.$message({
              message: '下载失败！',
              type: 'error',
              showClose: true
            });
          });
      } else if (val === 9) {
        // 预览
        if (!this.getCheckRowList().length) {
          this.$message.warning('请勾选相应表单后进行预览');
        } else if (this.getCheckRowList().length > 1) {
          this.$message.warning('只能勾选一个表单进行预览');
        } else {
          p().then(res => {
            window.open(
              `${res.url}/onlinePreview?fileId=${
                this.getCheckRowList()[0].FILEID
              }`
            );
          });
        }
      } else if (val === 10) {
        // 文件下载
        if (!this.getCheckRowList().length) {
          this.$message.warning('请勾选相应表单后进行文件下载');
        } else if (this.getCheckRowList().length > 1) {
          this.$message.warning('只能勾选一个表单进行文件下载');
        } else {
          const { FILEID, FILENAME } = this.getCheckRowList()[0];
          downFileNew({
            id: FILEID,
            fileName: FILENAME
          }).then(res => {
            this.saveFileToLocal(res, FILENAME);
          });
        }
      } else if (val === 11) {
        // 添加/编辑公告公示
        this.newBtnAdd(buttonName, 0);
      } else if (val === 12) {
        // 下载公告公示
        this.newBtndownLoad(buttonName, 0);
      } else if (val === 13) {
        // 添加/编辑抽查巡查
        this.newBtnAdd(buttonName, 1);
      } else if (val === 14) {
        // 下载抽查巡查
        this.newBtndownLoad(buttonName, 1);
      } else if (val === 15) {
        // 发票上传
        this.quotaInvoiceUpload();
      } else if (val === 16) {
        // 增值税发票上传
        this.getVatInvoiceUpload();
      } else if (val === 17) {
        if (this.chooseList.length > 0) {
          let formList = '';
          this.chooseList.map(o => {
            formList += o.FORMGUID + ',';
          });
          formList = formList.substring(0, formList.lastIndexOf(','));
          const params = {
            path: '/lodop',
            query: {
              formList: formList
              // isShow: true
            }
          };
          const routeUrl = this.$router.resolve(params);
          const tempwindow = window.open('_blank'); // 先打开页面
          tempwindow.location = routeUrl.href; // 后更改页面地址
        } else {
          this.$message({
            type: 'warning',
            message: '请选择需要打印的数据'
          });
        }
      } else if (val === 21) {
        // 批量编辑
        if (!this.getCheckRowList().length) {
          this.$message.warning(`请勾选相应表单后进行${buttonName}`);
        } else {
          this.batchEditHeader = this.form[this.tableId].headers;
          this.batchEditBody = this.getCheckRowList();
          this.batchEditShow = true;
        }
      } else if (val === 999999) {
        this.saveForm();
      }
    },

    getCheckRowList() {
      const { styleHead: { lineSelect }, radioSelectRow, checkbox } = this.form[this.tableId];
      let checkRowList = [];
      if (lineSelect === 1 && Object.keys(radioSelectRow).length) {
        checkRowList.push(radioSelectRow);
      } else if (lineSelect === 2) {
        checkRowList = checkbox;
      }
      return checkRowList;
    },

    newBtnAdd(val, status) {
      if (!this.getCheckRowList().length) {
        this.$message.warning(`请勾选相应表单后进行${val}`);
      } else if (this.getCheckRowList().length > 1) {
        this.$message.warning(`只能勾选一个表单进行${val}`);
      } else {
        const {
          FORMGUID,
          FILENO,
          PROGRAMNAME2,
          START_DATE,
          END_DATE,
          DEPARTMENTNAME,
          SUBSIDYCONTENT } = this.getCheckRowList()[0];
        getNotice({
          FORMGUID: FORMGUID,
          STATUS: status
        }).then(res => {
          if (res.data === '') {
            addNotice({
              FORMGUID,
              STATUS: status,
              FILENO: FILENO || '',
              PROGRAMNAME2: PROGRAMNAME2 || '',
              START_DATE: START_DATE || '2021-07-01',
              END_DATE: END_DATE || '2021-07-01',
              DEPARTMENTNAME: DEPARTMENTNAME || '',
              SUBSIDYCONTENT: SUBSIDYCONTENT || '',
              CONTENT: res.data.CONTENT || ''
            }).then(res1 => {
              this.editor = new E('#editor');
              // this.editor.config.height = 700;
              this.editor.create();
              this.editor.txt.html(res1.data.CONTENT);
              this.editorstatus = status;
              this.editorGuid = FORMGUID;
              this.$nextTick(() => (this.editorBtnflag = true));
            });
          } else {
            this.editor = new E('#editor');
            // this.editor.config.height = 700;
            this.editor.create();
            this.editor.txt.html(res.data.CONTENT);
            this.editorstatus = status;
            this.editorGuid = FORMGUID;
            this.$nextTick(() => (this.editorBtnflag = true));
          }
        });
      }
    },
    newBtndownLoad(val, status) {
      if (!this.getCheckRowList().length) {
        this.$message.warning(`请勾选相应表单后进行${val}`);
      } else if (this.getCheckRowList().length > 1) {
        this.$message.warning(`只能勾选一个表单进行${val}`);
      } else {
        const { FORMGUID, FILENO, PROGRAMNAME2 } = this.getCheckRowList()[0];
        downLoadNotice({
          FORMGUID,
          STATUS: status,
          FILENO: FILENO || ''
        }).then(res => {
          this.saveFileToLocal(res, PROGRAMNAME2);
        });
      }
    },
    editorBtn() {
      this.editorHtml = this.editor.txt.html();
      this.editor.destroy();
      this.editor = null;
      this.editorBtnflag = false;

      addNotice({
        FORMGUID: this.editorGuid,
        STATUS: this.editorstatus,
        CONTENT: this.editorHtml
      }).then(res => {
        if (res.success) {
          this.$message({
            message: res.message,
            type: 'success'
          });
        } else {
          this.$message({
            message: res.message,
            type: 'warning'
          });
        }
      });
    },
    editorHandle() {
      this.editor.destroy();
      this.editor = null;
      this.editorBtnflag = false;
    },
    // 发票识别close
    quotaInvoiceOk() {
      this.quotaInvoiceData = {};
      this.quotaInvoiceVisible = false;
    },
    quotaInvoiceCancel() {
      this.quotaInvoiceData = {};
      this.quotaInvoiceVisible = false;
    },
    async quotaInvoiceUpload() {
      const selFileEle = document.createElement('input');
      selFileEle.setAttribute('type', 'file');
      selFileEle.click();
      selFileEle.onchange = async e => {
        const file = e.path[0].files[0];
        const data = new FormData();
        data.append('image', file);
        const res = await getQuotaInvoice(data);
        if (res.success) {
          this.$message({
            message: res.message,
            type: 'success'
          });
          this.quotaInvoiceData = res.data.words_result;
          this.quotainvoiceFlag = 1;
          this.quotaInvoiceVisible = true;
        } else {
          this.$message({
            message: res.message,
            type: 'warning'
          });
        }
      };
    },
    async getVatInvoiceUpload() {
      const selFileEle = document.createElement('input');
      selFileEle.setAttribute('type', 'file');
      selFileEle.click();
      selFileEle.onchange = async e => {
        const file = e.path[0].files[0];
        const data = new FormData();
        data.append('image', file);
        const res = await getVatInvoice(data);
        if (res.success) {
          this.$message({
            message: res.message,
            type: 'success'
          });
          this.quotaInvoiceData = res.data.words_result;
          this.quotainvoiceFlag = 2;
          // this.quotaInvoiceVisible = true;
        } else {
          this.$message({
            message: res.message,
            type: 'warning'
          });
        }
      };
    },
    saveFileToLocal(blob, fileName) {
      const a = document.createElement('a');
      const url = window.URL.createObjectURL(blob);
      const filename = fileName;
      a.href = url;
      a.download = filename;
      a.click();
      window.URL.revokeObjectURL(url);
      a.remove();
    },
    getnumheader(arr, num = 0) {
      arr.forEach(item => {
        if (item.children) {
          num++;
          return this.getnumheader(item.children, num);
        }
      });
      return num;
    },

    handleSizeChange(val) {
      const { form, tableId } = this;
      form[tableId].searchBodyParams.pageIndex = 0;
      form[tableId].searchBodyParams.pageSize = val;
      this.getQueryBodyByProduce({
        tableId,
        ...form[tableId].searchBodyParams
      });
    },

    handleCurrentChange(val) {
      const { form, tableId } = this;
      form[tableId].searchBodyParams.pageIndex = val - 1;
      this.getQueryBodyByProduce({
        tableId,
        ...form[tableId].searchBodyParams
      });
    },
    // 获取报表表头信息以及子表基础信息
    getHeader({ menuId, formGuid }) {
      return getReportParentHeader({
        menuId,
        formGuid
      });
    },

    async tabClick({ $attrs: { data }}) {
      this.$emit('tabClick', this.activeTab);
      this.loading = true;
      this.apps = '';
      const {
        id: tableId,
        tableType,
        tableName,
        fontColor,
        fontSize,
        headerColor,
        lineHeight,
        lineSelect,
        storedReturnType,
        isAutoWidth,
        // 权限控制
        isAuthority,
        // 存储过程,没有就调物理表查询
        storedName
      } = data;
      this.tabInfo = data;
      const positionApp = {
        0: resolve =>
          require(['@/components/tableComponent/index.vue'], resolve), // 报表
        1: resolve => require(['@/components/CommonForm/index.vue'], resolve), // 表单
        2: resolve => require(['@/components/CommonTable/index.vue'], resolve) // 单子
      };
      this.tableId = tableId;
      this.tableType = tableType;
      this.tableName = tableName;
      data.buttons &&
        data.buttons.forEach(b => {
          b.isProcess = (b.isProcess && b.isProcess * 1) || 0;
        });
      // data.buttons && data.buttons.push({
      //   buttonName: '批量打印',
      //   buttonCode: 17

      // });
      this.tableButtons = data.buttons && data.buttons.length && data.buttons.filter(i => i.buttonCode !== 20);
      // 双击报表查看信息
      this.dbClickInfoBtn = data.buttons && data.buttons.find(i => i.buttonCode === 20) || {};
      const styleHead = {
        fontColor,
        fontSize,
        headerColor,
        lineHeight,
        lineSelect,
        storedReturnType, // 返回数据是否为树状
        isAutoWidth, // 报表是否自适应
        isAuthority, // 权限控制
        storedName
      };
      if (data.isLoadData) {
        await this.getHeaderByTableId(styleHead);
      } else {
        await this.getHeaderByTableId(styleHead, 'stop');
      }
      if (tableType in positionApp) {
        // 动态加载组件
        this.apps = positionApp[tableType];
        if (this.form[tableId] && tableType) {
          setTimeout(() => {
            this.getComponentsData();
          }, 300);
        }
      } else {
        this.apps = positionApp[0];
      }
      // 报表点击tabs刷新
      // if (!this.form[tableId]) {
      this.loading = true;
      // }
      if (JSON.stringify(this.form[tableId]) === '{}') {
        this.apps = '';
        this.loading = false;
      }

      if (this.apps === '0') {
        this.emptyAppWarn = true;
      }
    },
    // 更新数据
    updataTable() {
      const { form, tableId } = this;
      this.getQueryBodyByProduce({
        tableId,
        ...form[tableId].searchBodyParams
      });
    }
  }
};
</script>

<style lang="scss" scoped>
$vw: 1920px;
@function px2vw($px) {
  @return $px / $vw * 100vw;
}
.digital {
  // padding: 10px;
  height: 100%;
  .digital-report {
    height: 100%;
    background-color: #fff;
    padding: 0 20px;
    .digital-report-title {
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: 61px;
      .report-title {
        font-size: 24px;
      }
    }
    .digital-report-tabs {
      position: relative;
      .digital-report-tabs-tips{
        position: absolute;
        right: 10px;
        top: 10px;
        color: #1492ff;
      }
    }
    .digital-report-body {
      width: 100%;
      // height: calc(100% - 131px);
      overflow-y: auto;
      position: relative;
      .commonComponent_container_skeleton {
        background-color: #fff;
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 33;
        padding: 20px;
        padding-top: 60px;
        /deep/ .ant-skeleton-content .ant-skeleton-paragraph > li,
        /deep/ .ant-skeleton-content .ant-skeleton-title {
          height: 35px;
          border-radius: 8px;
        }
      }
    }
    .digital-report-pagination {
      display: flex;
      justify-content: flex-end;
      //页码样式
      ::v-deep .el-pagination.is-background {
        .el-pager li:not(.disabled).active {
          background-color: #1492ff;
          color: #fff;
        }
        .el-pager li {
          background-color: #fff;
          color: rgba(0, 0, 0, 0.65);
          border: 1px solid #dddddd;
        }
        .btn-prev,
        .btn-next {
          background-color: #fff;
          color: rgba(0, 0, 0, 0.65);
          border: 1px solid #dddddd;
        }
      }
      ::v-deep .el-pagination__jump {
        margin-left: 0;
      }
      ::v-deep .el-input__inner {
        height: 28px !important;
      }
    }
  }
}
.delbtn {
  color: #fc5c5c;
  border-color: #fc5c5c;
  &:hover {
    background-color: #fc5c5c1c;
  }
}
.tablebtn {
  color: #1492ff;
  border-color: #1492ff;
}
.addbtn {
  background: #1492ff;
  border-color: #1492ff;
}
.editor_box {
  position: absolute;
  top: 0;
  z-index: 9999999999;
  background-color: rgb(241, 241, 241);
  border-radius: 5px;
}

.editorTwo {
  padding: 5vh;
  padding-bottom: 0;
}
#editor {
  width: 1100px;
  // height:100%;
}
/deep/.w-e-text-container {
  height: 81vh !important;
}
/deep/.w-e-toolbar {
  height: 5vh !important;
  display: flex !important;
  align-items: center !important;
}
/deep/.w-e-toolbar {
  flex-wrap: nowrap;
}
.editorBtn {
  // position: absolute;
  // bottom: 2vh;
  // z-index: 99999999999;
  // left: 1100px;
  padding: 1vh 0;
  float: right;
  margin-right: 5vh;
}
 @media print {
  @page{
      size:  auto;
      margin: 3mm;
	}
  /deep/.w-e-toolbar{
    display: none!important;
  }
  /deep/.w-e-text-container{
    border: none!important;
    // padding: 10px;
  }
}

</style>
